package Mi;

require Exporter;
require AutoLoader;
require DynaLoader;
@ISA = qw(Exporter AutoLoader DynaLoader);
# Items to export into callers namespace by default
# (move infrequently used names to @EXPORT_OK below)
@EXPORT = qw(
	MI_ALERTER_DROPPED
	MI_ALERTER_FIRED
	MI_ALLOCATED_RESULT
	MI_ARRAY_VALUE
	MI_COPY_INPUT
	MI_COPY_OUTPUT
	MI_DDL
	MI_DML
	MI_ERROR
	MI_EXCEPTION
	MI_FATAL
	MI_FUNCTION_RESULTS
	MI_INTERNAL_REP_RESULT
	MI_LARGE_OBJECT_VALUE
	MI_LIB_BADARG
	MI_LIB_BADSERV
	MI_LIB_DROPCONN
	MI_LIB_INTERR
	MI_LIB_NOIMP
	MI_LIB_USAGE
	MI_MAX_FUNC_ARGS
	MI_MESSAGE
	MI_NORMAL_VALUE
	MI_NOTICE
	MI_NO_MORE_RESULTS
	MI_NO_RESULT
	MI_NULL_RESULT
	MI_NULL_VALUE
	MI_N_CALLBACK_EVENTS
	MI_PORTAL_VALUE
	MI_QUERY_BINARY
	MI_QUERY_NORMAL
	MI_ROWS
	MI_ROW_VALUE
	MI_SQL
	MI_USE_DEFAULT_PORT
	MI_WARN
);
# Other items we are prepared to export if requested
@EXPORT_OK = qw(
);

sub AUTOLOAD {
    if (@_ > 1) {
	$AutoLoader::AUTOLOAD = $AUTOLOAD;
	goto &AutoLoader::AUTOLOAD;
    }
    local($constname);
    ($constname = $AUTOLOAD) =~ s/.*:://;
    $val = constant($constname, @_ ? $_[0] : 0);
    if ($! != 0) {
	if ($! =~ /Invalid/) {
	    $AutoLoader::AUTOLOAD = $AUTOLOAD;
	    goto &AutoLoader::AUTOLOAD;
	}
	else {
	    ($pack,$file,$line) = caller;
	    die "Your vendor has not defined Mi macro $constname, used at $file line $line.
";
	}
    }
    eval "sub $AUTOLOAD { $val }";
    goto &$AUTOLOAD;
}

bootstrap Mi;

# Preloaded methods go here.  Autoload methods go after __END__, and are
# processed by the autosplit program.

1;
__END__
